<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" value="请输入" id="txt1" onfocus="if(this.value=='请输入'){this.value=''}console.log(this);">
<input type="text" value="请输入" id="txt2" onfocus="fun(this)">
<input type="text" value="请输入" id="txt3" onfocus="fun(this)">
<script>
    function fun(that){
        console.log("a")
        if(that.value=='请输入'){that.value=''}
        console.log(that);
    }


    var txt3 = document.getElementById('txt3');
    txt3.onclick = function(){
        if(this.value=='请输入'){this.value=''}console.log(this);
    }

    //window


</script>
<script>

</script>
</body>
</html>